import http from "@/utils/request"
// 获取商品
export let getProductlistApi = (productid?: string, categoryid?: string) => {
    return http.get('/product/get_product', {
        params: {
            productid: productid,
            categoryid: categoryid
        }
    })
}
// 添加商品信息
type IproductData = {
    category_id: string;
    productName: string;
    price: Number;
    description: string;
    inventory: number;
    imageUrl: string;
    product_id:string;
}

export let addProductApi = (data: IproductData) => http.post('/product/add_product', data)
// export let getaddProductApi = (category_id: string, productName: string, price: Number, description: string, inventory: number, imageUrl: string) => http.post('/product/add_product', {
//     category_id,
//     productName,
//     price,
//     description,
//     inventory,
//     imageUrl
// })
// 删除商品信息
export let delProductApi =(product_id:any)=>http.get("/product/del_product",{
    params:{
        product_id
    }
})
// 修改商品信息
export let updateProductApi = (product_id: string) => 
http.post('/product/update_product', {
    product_id,
})



